//
//  RzRecommendCell.m
//  SportGo
//
//  Created by rimi on 16/9/20.
//  Copyright © 2016年 Yrzteam. All rights reserved.
//

#import "RzRecommendCell.h"

@interface RzRecommendCell()
@property(nonatomic,strong)UIImageView *headImageView;
@property(nonatomic,strong)UILabel *nameLabel;
@property(nonatomic,strong)UILabel *introLabel;
@end
@implementation RzRecommendCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _dic = [NSDictionary dictionary];
        [self addSubview:self.headImageView];
        [self addSubview:self.nameLabel];
        [self addSubview:self.introLabel];
    }
    return self;
}
- (void)layoutSubviews{
    [super layoutSubviews];
    self.headImageView.frame = RzCGRectMake(10, 20, 60, 70);
    self.nameLabel.frame = RzCGRectMake(80, 25,250, 20);
    self.introLabel.frame = RzCGRectMake(80, 45, 250, 40);

}
- (void)setDic:(NSDictionary *)dic{
   _dic = dic;
    
    [self.headImageView sd_setImageWithURL:[NSURL URLWithString:_dic[@"headUrl"]]];
    self.nameLabel.text = _dic[@"title"];
    self.introLabel.text = _dic[@"intro"];
    

}

#pragma mark -- lazy
- (UIImageView *)headImageView{
    if (!_headImageView) {
        _headImageView = [[UIImageView alloc]init];
       
    }
    return _headImageView;
}
- (UILabel *)nameLabel{
    if (!_nameLabel) {
        _nameLabel = [[UILabel alloc]init];
        _nameLabel.font = [UIFont systemFontOfSize:16];
        _nameLabel.textColor = [UIColor blackColor];
    }
    return _nameLabel;
}
- (UILabel *)introLabel{
    if (!_introLabel) {
        _introLabel = [[UILabel alloc]init];
        _introLabel.font = [UIFont systemFontOfSize:13];
        _introLabel.numberOfLines = 2;
        _introLabel.textColor = [UIColor lightGrayColor];
    }

    return _introLabel;
}
@end
